#pragma once
#include "RpcConnectPool.hpp"
#include "Singleton.hpp"
#include "const.hpp"
#include "message.grpc.pb.h"
#include "message.pb.h"
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/support/status.h>
using grpc::Channel;
using grpc::ClientContext;
using grpc::Status;

using message::GetChatServerReq;
using message::GetChatServerRsp;
using message::LoginReq;
using message::LoginRsp;
using message::StatusService;

class StatusGrpcClient : public Singleton<StatusGrpcClient> {
  friend class Singleton<StatusGrpcClient>;

public:
  ~StatusGrpcClient();
  GetChatServerRsp GetChatServer(int uid);
  LoginRsp Login(int uid, std::string token);

private:
  StatusGrpcClient();
  std::unique_ptr<RpcConnectPool<StatusService>> _pool;
};